function drawFireWorks
% 生成随机点
L=800;
fwPic=imnoise(zeros(L),'gaussian',0,0.1);
fwPic(fwPic<0.996)=0;
% 图形学膨胀
fwPic=imdilate(fwPic,strel('square',3));

% 特效[风]
for i=1:180
    tPic=[zeros(L,1),fwPic(:,1:end-1)].*.99;
    fwPic(fwPic<tPic)=tPic(fwPic<tPic); 
end

% 极坐标变换
[t,r]=meshgrid(linspace(-pi,pi,L),L:-1:1);
[X,Y]=meshgrid((1:2*L)-L-.5);
[T,R]=cart2pol(X,Y);
fwPic=interp2(t,r,fwPic',T,R,'linear',0);

% 中心模糊
fwPic=imgaussfilt(fwPic,1.5);
fwPic=fwPic./max(max(fwPic)).*1.02;

% 图像上色
CList=[239,250,210
       229,164,122
       232,150,138
       255,164,204
       192,58 ,111
       158,10 ,26
       224,168,121];
% CList=bone().*255;
% CList=pink().*255;
% CList=winter().*255;
CNum=size(CList,1);
tList=linspace(0,1,CNum);
RMat=R./max(max(R));
rPic=interp1(tList,CList(:,1),RMat).*fwPic;
gPic=interp1(tList,CList(:,2),RMat).*fwPic;
bPic=interp1(tList,CList(:,3),RMat).*fwPic;
fwPic=uint8(cat(3,rPic,gPic,bPic));
imshow(fwPic)
end

